package com.kstech.ks_gaz01

import com.blankii.androidlibrary.utils.CRC16Util
import com.blankii.androidlibrary.utils.CalcUtil
import com.blankii.androidlibrary.utils.OptimizeHelper
import org.junit.Test

/**
 * author: blankii
 * created on: 2025/8/18 16:11
 * description:
 */

class Main2 {
    //01 03 2A 24 ba 00 02 00 03 ff f1 00 05 00 06 00 07 00 08 00 09 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 18 00 19 00 20 00 21
    //01 03 2A 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 00 09 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 18 00 19 00 20
    @Test
    fun main1() {
        val crc =
            CRC16Util.getCRC((CalcUtil.Hex2Byte("01 03 2A 24 ba 00 02 00 03 ff f1 00 05 00 06 00 07 00 08 00 09 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 18 00 19 00 20 00 21")))
        val crc1 =
            CRC16Util.getCRC((CalcUtil.Hex2Byte("01 03 17 79 00 15")))
        println(crc)
    }
    @Test
    fun main() {
        OptimizeHelper.check("你好", object : OptimizeHelper.Task {
            override fun execute() {
                Thread.sleep(3000)
            }
        })
    }
}